import http from "@/utils/http";

/**
 * 首页-广告区域-小程序
 * @param {number} distributionSite 1 - 首页（默认值） 2 - 为商品分类页
 */
export const getHomeBanner = (distributionSite = 1) => {
  return http({
    url: "/home/banner",
    data: {
      distributionSite,
    },
  });
};

/**
 * 首页-前台分类-小程序
 */
export const getHomeCategoryMutli = () => {
  return http({
    url: "/home/category/mutli",
  });
};

/**
 * 首页-热门推荐-小程序
 */
export const getHomeHotMutli = () => {
  return http({
    url: "/home/hot/mutli",
  });
};

/**
 * 首页-新鲜好物-小程序
 */
export const getHomeNew = (limit = 4) => {
  return http({
    url: "/home/new",
    data: { limit },
  });
};

/**
 *
 * @param {object} data { page:1, pageSize:10 }
 */
export const getHomeGoodsGuessLike = (data) => {
  return http({
    url: "/home/goods/guessLike",
    data,
  });
};

/**
 * 人气推荐
 * @param {string} url 请求url
 * @param {object} data 请求数据 - subType-类型id，page-页码，pageSize-数量
 */
export const getHomeRecommend = (url, data) => {
  return http({
    url,
    data,
  });
};
